# -*- coding: utf-8 -*- 
#!/usr/bin/env python
import sys
sys.path.append("~/5a-bucarest-vallee-cedric/asois/project")
import orange

class Filter:
	def __init__(self):
		print "init filt"
		self.file=""

	def isSpam(mail):
		pass
	def userDecision():
		pass
 
class kwordFilter(Filter):
	def __init__(self):
		print "init keyword filter"
		self.file= "filters/contentBlock.txt"
		f = open(self.file,'r')
		self.list = f.readlines()
		self.list = [s.replace("\n","") for s in self.list]
		f.close()

	def isSpam(self,mail):
		for k in self.list:
			if k in str(mail):
				return True
		return False


if __name__ == "__main__":
	obj = kwordFilter() 

	
	
